import {tableCloum} from '@/components/XTable/constant'
import { defineComponent } from 'vue'

export const tableConfigure:tableCloum[] = [
    {
        label: '账号',
        prop: 'userName',
        overflow: true,
        // width: 100,
      },
      {
        label: '用户名',
        prop: 'nickName',
        overflow: true,
        // width: 100,
      },
      {
        label: '电话',
        prop: 'mobile',
        overflow: true,
        // width: 100,
      },
      {
        label: '邮箱',
        prop: 'email',
        overflow: true,
        // width: 150,
      },
      {
        label: '创建日期',
        prop: 'createdAt',
        overflow: true,
        // width: 150,
      },
      {
        label: '更新日期',
        prop: 'updatedAt',
        overflow: true,
        // width: 150,
      },
      {
        label: '权限',
        prop: 'role',
        overflow: true,
        key: 'tag',
        width: 100,
        customRender: (text) =>
          text === 1 ? 'admin' : 'normal',
        // customRender: (text) =>
        //   text === 1 ? Tag('admin') : Tag('normal'),
      },
      {
        label: '操作',
        key: 'actions',
        width: 200,
        actionsList: [
          {
            text: '修改',
            buttonType: 'primary',
            icon: 'Edit',
            cb: () => {}
          },
          {
            text: '删除',
            buttonType: 'primary',
            icon: 'Delete',
            cb: () => {}
          },
        ]
        // fixed: 'right',
        // slots: { customRender: 'action' }, // 该用法已废弃
      },
]

const Tag = (text) => {
  return `<el-tag>${text}</el-tag>`
}
// const Tag = (text) => {
//   return defineComponent({
//     setup(props, ctx) {
        
//     },
//     template: `<el-tag>${text}</el-tag>`
//   })
// }